package com.zqu.controller;

import com.zqu.pojo.ClientUser;
import com.zqu.service.ClientUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("clientuser")
public class ClientUserController {

    @Autowired
    private ClientUserService clientUserService;

    @RequestMapping("findclientuser")
    @ResponseBody
    public ClientUser selectById(long id){
        return clientUserService.selectClientUserById(id);
    }

    @RequestMapping("selectlientuserlist")
    @ResponseBody
    public List<ClientUser> selectList(){
        return clientUserService.selectList(new ClientUser());
    }

    @RequestMapping("insertclientuser")
    @ResponseBody
    public boolean insert(){
        return clientUserService.insertClientUser(new ClientUser());
    }

    @RequestMapping("updateclientuser")
    @ResponseBody
    public boolean update(){
        return clientUserService.updateClientUser(new ClientUser());
    }

    @RequestMapping("deleteclientuser")
    @ResponseBody
    public boolean delete(long id){
        return clientUserService.deleteClientUser(id);
    }

    @RequestMapping("deleteclientuserbyids")
    @ResponseBody
    public boolean deleteByIds(String[] ids){
        return clientUserService.deleteClientUserByIds(ids);
    }
}
